/* 表单元素样式 */
.form-group {
    margin-bottom: 0.50rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.20rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-label .required {
    color: var(--color-danger);
    margin-left: 0.25rem;
}

.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-white);
    background-clip: padding-box;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: 0;
}

.form-input::placeholder {
    color: var(--color-text-disabled);
    opacity: 1;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 16px;
    padding-right: 2.5rem;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
}

.form-error {
    display: block;
    margin-top: 0.375rem;
    font-size: var(--font-size-xs);
    color: var(--color-danger);
    min-height: 1.25rem;
}

.form-help {
    display: block;
    margin-top: 0.375rem;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.form-input-sm {
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
}

.form-input-lg {
    padding: 1rem 1.25rem;
    font-size: var(--font-size-lg);
}

.form-input.is-valid {
    border-color: var(--color-success);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2334a853' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 16px;
}

.form-input.is-invalid {
    border-color: var(--color-danger);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ea4335' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 16px;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group .form-input {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-prepend,
.input-group-append {
    display: flex;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-md);
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
}

.input-group-prepend .input-group-text {
    border-right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.input-group-append .input-group-text {
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.input-group > .form-input:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .form-input:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.form-floating {
    position: relative;
}

.form-floating > .form-input {
    padding: 1.5rem 1rem 0.5rem;
    height: calc(3.5rem + 2px);
}

.form-floating > .form-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
}

.form-floating > .form-input::-webkit-input-placeholder {
    color: transparent;
}

.form-floating > .form-input:focus,
.form-floating > .form-input:not(:placeholder-shown) {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.form-floating > .form-input:focus ~ .form-label,
.form-floating > .form-input:not(:placeholder-shown) ~ .form-label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.form-remember {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.form-remember input[type="checkbox"] {
    margin-right: var(--spacing-sm);
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.form-remember label {
    color: var(--light-text);
    font-size: var(--font-sm);
}

.form-links {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-sm);
    margin-top: var(--spacing-md);
}

.form-links a:hover {
    text-decoration: underline;
}

/* 动画效果 */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
} 